The present invention generally relates to image processing. More specifically, the present invention relates to an image processing method and system using a low-complexity scheme.
FIG. 1 is a simplified block diagram illustrating a typical image color conversion process. It is typical for image codecs, such as those using the JPEG and MPEG formats, to perform color conversion from the red-green-blue (RGB) model to the YCbCr model, where Y is the luminance component, Cb is the chrominance component for blueness and Cr is the chrominance component for redness. In addition, in order to achieve data reduction, a down-sampling process is performed according to the visual perception of the image being processed. For different components, different down-sampling frequencies may be used. Down-sampling can also be made both vertically and horizontally. As a result, various combinations of down-sampled image data can be obtained for additional processing.
One rate that is commonly used for down-sampling is “4:2:0”, which means that no down-sampling is performed on the Y component and “2:1” vertical and horizontal down-sampling is performed for the Cb component and the Cr component. With the “4:2:0” down-sampling rate, a fifty percent (50%) data reduction can be achieved.
From a computational complexity perspective, however, the color conversion and down-sampling processes are very expensive. That is, a large number of computations are typically needed to process the desired image data. For example, as will be further illustrated below, with a down-sampling rate of “4:2:0” and average processing taken into account, thirteen (13) multiplications and fifteen (15) additions are required to get a down-sampled Cb or Cr component from corresponding RGB formats.
FIG. 2 is a simplified diagram illustrating a down-sampling rate of “4:2:0”. Equations for RGB to YCbCr conversion can be roughly expressed as:Y=0.29900R+0.58700G+0.11400B Cb=−0.16874R−0.33126G+0.50000B+2SP/2 Cr=0.50000R−0.41869G−0.08131B+2SP/2  Eqs. (1)where “SP” stands for sample precision. Let Y0′, Y1′, Y2′, Y3′ and Y0″, Y1″, Y2″, Y3″ denote the Y component before and after down-sampling, respectively. Likewise, let Cb0′, Cb1′, Cb2′, Cb3′ and Cb″ denote the Cb component and Cr0′, Cr1′, Cr2′, Cr3′ and Cr″ denote the Cr component, before and after down-sampling, respectively. According to the above definition, for average down-sampling, the following represents equations that can be used to obtain the Y, Cb and Cr components under the YCbCr model:
                                                                        Y                i                ″                            =                            ⁢                              Y                i                ′                                                                                                        Cb                ″                            =                            ⁢                                                1                  4                                ⁢                                  (                                                            Cb                      0                      ′                                        +                                          Cb                      1                      ′                                        +                                          Cb                      2                      ′                                        +                                          Cb                      3                      ′                                                        )                                ⁢                                                                  ⁢                                  (                                                                                    for                        ⁢                                                                                                  ⁢                        i                                            =                      0                                        ,                    1                    ,                    2                    ,                    3                                    )                                                                                                                        Cr                ″                            =                            ⁢                                                1                  4                                ⁢                                  (                                                            Cr                      0                      ′                                        +                                          Cr                      1                      ′                                        +                                          Cr                      2                      ′                                        +                                          Cr                      3                      ′                                                        )                                                                                        Eqs        .                                  ⁢                  (          2          )                    
Referring to Eqs. (1), to convert each RGB pixel to obtain Cbi′ before down-sampling, three (3) multiplications and three (3) additions are needed, that is, one (1) multiplication each for each RGB component and three (3) additions to sum up the result. Likewise, the same number of multiplications and additions are needed to obtain Cri′ before down-sampling.
Referring to Eqs. (2), to obtain Cb″ after down-sampling from RGB, fifteen (15) (3×4+3=15) additions and thirteen (13) (3×4+1=13) multiplications are needed. Likewise, the same number of multiplications and additions are needed to obtain Cr″ after down-sampling.
From a computational complexity perspective, the computational cost to carry out the foregoing becomes very expensive as the number of pixels and the number of bits representing each pixel increase. For each pixel to be converted from the RGB model to the YCbCr model, thirteen (13) multiplications and fifteen (15) additions are required in order to obtain a down-sampled Cb″ or Cr″ component.
It should be noted that the foregoing example is given merely for illustrative purposes. In order to calculate the down-sampled Cb″ and Cr″ components, more generalized equations can be used as follows:Cb″=α0Cb0′+α1Cb1′+α2Cb2′+α3Cb3′Cr″=β0Cr0′+β1Cr1′+β2Cr2′=β3Cr3′  Eqs. (3)
Note that Eqs. (2) above are merely specific instances of Eqs. (3) where αi and βi are one-quarter (¼), where i=0, 1, 2, 3. Similarly, using Eqs. (1) and (3), it can be seen that in order to calculate the down-sampled Cb″, sixteen (16) multiplications and fifteen (15) additions are needed; and the down-sampled Cr″ need the same number of multiplications and additions.
One simple way to reduce this computational complexity is to re-use the value of a pixel for a predetermined number of adjacent, contiguous pixels. In other words, a predetermined number of pixels are skipped and are assumed to have the same values. The drawback of this approach is that it produces serious block effects which compromise the quality of the processed image. Moreover, in order to reduce block effects, filtering processing may need to be performed which adds to the computational costs.
Hence, it would be desirable to provide a method and system that is capable of producing a relatively high image quality at reduced computational costs.